package easy.id_0_100;

public class Lee14 {
    public String longestCommonPrefix(String[] strs) {
        int index=0;
        String result="";
        while(index<strs[0].length()){
            for(String item:strs){
                if(index>=item.length() || item.charAt(index)!= strs[0].charAt(index)){
                    return result;
                }
            }
            result+=strs[0].charAt(index);
            index++;
        }
        return result;
    }
}
